#include "Control/GUIWindow.h"

namespace YGUI
{
    struct VisibleDefaultTest : public DefaultTestBase
    {
        static VisibleDefaultTest* getPtr(void) { static VisibleDefaultTest instance; return &instance; }
        bool isDefault(const PropertyReceiver* receiver) const
        { return static_cast<const Window*>(receiver)->isVisible(true); }
    };

    struct DisabledDefaultTest : public DefaultTestBase
    {
        static DisabledDefaultTest* getPtr(void) { static DisabledDefaultTest instance; return &instance; }
        bool isDefault(const PropertyReceiver* receiver) const
        { return static_cast<const Window*>(receiver)->isDisabled(true); }
    };

    IMPLEMENT_Property(Window, Alpha, 0, "Property to get/set the alpha value of the Window.  Value is floating point number.");
    IMPLEMENT_Property(Window, ClippedByParent, 0, "Property to get/set the 'clipped by parent' setting for the Window.  Value is either \"True\" or \"False\".");
    IMPLEMENT_Property(Window, InheritsAlpha, 0, "Property to get/set the 'inherits alpha' setting for the Window.  Value is either \"True\" or \"False\".");
    IMPLEMENT_Property(Window, TopMost, 0, "Property to get/set the 'always on top' setting for the Window.  Value is either \"True\" or \"False\".");
    IMPLEMENT_Property(Window, AutoRenderingSurface, 0, "Property to get/set whether the Window will automatically attempt to use"
        " a full imagery caching RenderingSurface (if supported by the renderer). Here, full imagery caching usually will mean"
        " caching a window's representation onto a texture (although no such implementation requirement is specified.) "
        "Value is either \"true\" or \"false\".");
    IMPLEMENT_Property(Window, UnifiedPosition, 0, "Property to get/set the windows unified position. Value is a \"UVector2\".");
    IMPLEMENT_Property(Window, UnifiedSize, 0, "Property to get/set the windows unified size.  Value is a \"UVector2\".");
    IMPLEMENT_Property(Window, UnifiedAreaRect, 0, "Property to get/set the windows unified area rectangle. Value is a \"URect\".");
    IMPLEMENT_Property(Window, Text, 0, "Property to get/set the text / caption for the Window. Value is the text string to use.");
    IMPLEMENT_Property(Window, Visible, VisibleDefaultTest::getPtr(), "Property to get/set the 'visible state' setting for the Window."
        "Value is either \"true\" or \"false\".");
    IMPLEMENT_Property(Window, Disabled, DisabledDefaultTest::getPtr(), "Property to get/set the 'disabled state' setting for the Window."
        "Value is either \"true\" or \"false\".")

    void Window::addProperties(void)
    {
        this->addProperty(&Window::Alpha);
        this->addProperty(&Window::ClippedByParent);
        this->addProperty(&Window::InheritsAlpha);
        this->addProperty(&Window::TopMost);
        this->addProperty(&Window::AutoRenderingSurface);
        this->addProperty(&Window::UnifiedPosition);
        this->addProperty(&Window::UnifiedSize);
        this->addProperty(&Window::UnifiedAreaRect);
        this->addProperty(&Window::Text);
        this->addProperty(&Window::Visible);
        this->addProperty(&Window::Disabled);
    }
}